% Displays predicted coherencies
% Input Structured array SPM

% Latest date 8.7.2003

function[a]=DispCoh(SPM),

if isstruct(SPM) ~=1,
   return;
end;

for i = 1:length(SPM.spectra),
   ProcDef.TLFreq1(i) =SPM.spectra(i).freq;
end;
ProcDef.file1 = SPM.head.site;

C1 = pcoh(SPM,'Ex');
C2 = pcoh(SPM,'Ey');
c1 = 'r*';
c2 = 'b*';

if ishold == 1,
   c1 = 'c*';
   c2 = 'g*';
end;

semilogx(1./ProcDef.TLFreq1,C1,c1);
hold on;
semilogx(1./ProcDef.TLFreq1,C2,c2);

legend('Ex','Ey');
title(sprintf('Predicted coherency - %s',SPM.head.site));
xlabel('LOG Period (s)');
ylabel('Coherency');






